package com.jk.dmsearchprovider.service;

import com.jk.dmcommon.djhEntity.CityEntity;
import com.jk.dmcommon.djhEntity.GoodsTypeEntity;
import com.jk.dmcommon.entity.ShopEntity;
import com.jk.dmsearchprovider.controller.SearchController;
import com.jk.dmsearchprovider.dao.SearchDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SearchService {
    @Autowired
    private SearchDao searchDao;

    /**
     * chengshi
     * @return
     */
    public List<CityEntity> selectAllCity() {
        return searchDao.selectAllCity();
    }

    /**
     * lei xing
     * @return
     */
    public List<GoodsTypeEntity> selectAllType() {
        return searchDao.selectAllType();
    }

    /**
     * cha xun  shang pin
     * @param cityId
     * @param typeId
     * @param timeShow
     * @return
     */
    public List<ShopEntity> selectGoodsByType(String cityId, String typeId, String timeShow,String searchButtongoods,Integer orderdesc) {

        return searchDao.selectGoodsByType(cityId,typeId,timeShow,searchButtongoods,orderdesc);
    }

    /**
     * 查询商品个数
     * @param cityId
     * @param typeId
     * @param timeShow
     * @param searchButtongoods
     * @param orderdesc
     * @return
     */
    public Integer selectGoodsCount(String cityId, String typeId, String timeShow, String searchButtongoods, Integer orderdesc) {
        return searchDao.selectGoodsCount(cityId,typeId,timeShow,searchButtongoods,orderdesc);
    }
}
